<?
class ECatalogSelect extends CWidget {
	 
	var $assets;
	var $options;
	var $model;
	var $name;
	
	public function init(){
		$this->assets = Yii::app()->assetManager->publish(Yii::getPathOfAlias('catalog.extensions.catalogSelect.assets'));
		
		$cs = Yii::app()->getClientScript();
		$cs->registerCoreScript('jquery');
		
		$cs->registerCssFile($this->assets.'/css/thickbox.css');
		$cs->registerCssFile($this->assets.'/css/ECatalogSelect.css');
		$cs->registerScriptFile($this->assets.'/js/thickbox.js', CClientScript::POS_BEGIN);
		$cs->registerScript(__CLASS__,'var tb_pathToImage = "'.$this->assets.'/images/loadingAnimation.gif";', CClientScript::POS_HEAD);
	}
	
	public function run(){
		print_r($this->options['select']);
		$this->render(__CLASS__, array(
			'id'=>$this->id,
			'model'=>$this->model,
			'name'=>$this->name,
			'options'=>$this->options,
		));
	}
}
?>